class KeHu(models.Model):
    name = models.CharField(max_length=10,unique=True)
    yeiwu = models.CharField(max_length=10)
    area = models.CharField(max_length=10,unique=True)
    lianxiren = models.CharField(max_length=10)
    youzhengbianma = models.CharField(max_length=10,unique=True)
    yeiwuyuan = models.CharField(max_length=30)
    class Meta:
        db_table = "KeHu"

class Jinchu(models.Model):
    gongsiname = models.ForeignKey(KeHu,to_field="name",on_delete=models.CASCADE,related_name="names")
    ditetime = models.CharField(max_length=100,unique=True)
    number = models.IntegerField(default=0,unique=True)
    class Meta:
        db_table ="Jinchu"

class Areas(models.Model):
    diquname = models.ForeignKey(KeHu,to_field="area",on_delete=models.CASCADE,related_name="areaa")
    bianmaname = models.ForeignKey(KeHu,to_field="youzhengbianma",on_delete=models.CASCADE,related_name="ywbm")
    class Meta:
        db_table = 'Areas'